# !/usr/bin/env python
# -*- coding:utf-8 -*-
# @FileName : zsj.py
# @Time     : 2024/4/24 22:36
# @Author   : Robot-Zsj
"""
description:

i:
10

o:
1
"""
import decimal
from decimal import Decimal

decimal.setcontext(decimal.Context(prec=2500))

m = int(input())
factor = []


def initFactor(n):
    factor.append(Decimal(1))
    for i in range(1, n + 1):
        factor.append(Decimal(i) * factor[-1])


def getPermutationCount(oneCount, twoCount):
    if oneCount == 0 or twoCount == 0:
        return 1
    else:
        return factor[oneCount + twoCount] / factor[oneCount] / factor[twoCount]


def getResult():
    initFactor(m - 7)
    oneCount = m - 7
    twoCount = 0

    ans = Decimal(0)

    while oneCount >= 0:
        if (oneCount + twoCount) % 2 != 0:
            ans += getPermutationCount(oneCount, twoCount)

        oneCount -= 2
        twoCount += 1

    return ans


print("{:.0f}".format(getResult()))
